// import citys from './citys'

const points = [{ lng: 121.487899486, lat: 31.24916171 }, { lng: 114.025973657, lat: 22.5460535462 }, { lng: 116.395645038, lat: 39.9299857781 }, { lng: 120.219375416, lat: 30.2592444615 }]
const faultMessage = [{
        time: '2022-05-09',
        text: 'xxx设备出现异常,无法正常使用'
    },
    {
        time: '2022-05-10',
        text: 'xxx设备出现异常,需要进行维护'
    }, {
        time: '2022-05-08',
        text: 'xxx设备出现异常,电源损坏'
    }, {
        time: '2022-05-05',
        text: 'xxx设备出现异常,需要进行维护1'
    }, {
        time: '2022-05-11',
        text: 'xxx设备出现异常,需要进行维护2'
    }, {
        time: '2022-05-08',
        text: 'xxx设备出现异常,需要进行维护3'
    }, {
        time: '2022-05-09',
        text: 'xxx设备出现异常,需要进行维护4'
    }
]
const pointMessage = {
    facsum: 123,
    fault: 24,
    normal: 85,
    maintain: 12
}
module.exports = [
    // get allfacdata
    {
        url: '/vue-admin-template/map/getallfac',
        type: 'get',
        response: config => {
            const { token } = config.query

            // mock error

            if (!token) {
                return {
                    code: 60204,
                    message: 'Account and password are incorrect.'
                }
            }

            return {
                code: 20000,
                data: allfacdata
            }
        }
    },

    // get points
    {
        url: '/vue-admin-template/map/points',
        type: 'get',
        response: config => {

            const { token } = config.query
                // mock error
            if (!token) {
                return {
                    code: 60204,
                    message: 'Account and password are incorrect.'
                }
            }
            return {
                code: 20000,
                data: points
            }
        }
    },
    // get faultMessage
    {
        url: '/vue-admin-template/map/faultMessage',
        type: 'get',
        response: config => {
            const { token } = config.query
            return {
                code: 20000,
                data: faultMessage
            }
        }
    },
    // post pointMessage
    {
        url: '/vue-admin-template/map/pointMessage',
        type: 'post',
        response: config => {
            const { username } = config.body
            return {
                code: 20000,
                data: pointMessage
            }
        }
    },
]